import { controller, httpGet as Get, httpPost as Post } from 'inversify-express-utils'
import { UserService } from './services'
import { inject } from 'inversify'
import type { Response, Request } from 'express'


@controller('/user')
export class User {

  constructor(@inject(UserService) private readonly userService: UserService) {
  }

  @Get('/index')
  public getIndex(req: Request, res: Response) {
    let result = this.userService.getList()
    res.send(result)
  }

  @Post('/create')
  public createUser(req: Request, res: Response) {
    console.log(req.body)
    let result = this.userService.createUser()
    res.send(result)
  }
}